package com.huaxin.service;

import com.huaxin.entity.ProductInfo;
import com.huaxin.mapper.ProductInfoMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author Corday
 * @Create 2020/5/25 16:46
 */
@Service
public class ProductServiceImpl implements ProductService {
    @Resource
    private ProductInfoMapper productInfoMapper;

    @Override
    public List<ProductInfo> queryByStatus(Integer status) {
        int number = 5;
        if (status == 1) {
            number = 5;
        } else if (status == 2) {
            number = 6;
        } else if(status==3) {//分类查看更多商品
            number = 999999;
        }
        return productInfoMapper.selectByStatus(status, number);
    }
}
